<?php

require_once("includes/database.php");

class BangDiemRenLuyen extends database {
	private $maSo;
	private $mucMaSo;
	
	public function __construct($new = false) {
		parent::__construct($new);
		$result = $this->select("BANG_DIEM_REN_LUYEN", array("BDRL_MA_SO"),
								"BDRL_NGAY_AP_DUNG = (select max(BDRL_NGAY_AP_DUNG) from BANG_DIEM_REN_LUYEN)");
		$row = mysql_fetch_assoc($result);
		$this->maSo = $row['BDRL_MA_SO'];
	}
	
	public function getMaSo() { return $this->maSo; }
	
	public function getMaSoMuc() {
		$result = $this->select("CO_MUC", array("MUC_MA_SO"),
								"BDRL_MA_SO = " . $this->maSo . " ORDER BY MUC_CO_THU_TU");
		$this->mucMaSo = array();
		while ($row = mysql_fetch_assoc($result))
			$this->mucMaSo[] = $row['MUC_MA_SO'];
		return $this->mucMaSo;
	}
}

?>